
###  Plot Hegemonic Volatility Measure ### 



rm(list=ls()) 
 
library(foreign)
library(rgl)



setwd("/Users/davidcarter/Dropbox/Systemic Crisis Rep/")


vol<-read.dta("systemic_yearly_summary2_old.dta")
attach(vol)


### Systemic Instability Measure (figure 1) ##

## Note: Make plot and then stretch it into a rectangle before saving as .pdf ##


plot(c(1816,2001),range(hegevolatility00),type="n",xlab="Year",ylab="Systemic Instability" , xaxt="n")

lines(year[1:186], hegevolatility00[1:186],lwd=3)
axis(1, at = seq(1816, 2000, by = 4), las=2)

claims<-read.dta("yearly_claims_data.dta")
attach(claims)


par(new = T)
with(claims, plot(year[1:186], num_claims[1:186],lwd=2,lty=1,col="red",type="l", yaxt="n",xaxt="n",ylab="",xlab=""))
axis(side = 4)
mtext(side = 4, 'Number of Claim Onsets')

legend(1818,22,legend=c("Systemic Instability"),lty=1,lwd=3,bty="n",cex=1.25)
legend(1818,20,legend=c("Number of Claim Onsets"), lty=1,lwd=2,bty="n",col="red",cex=1.25)

